/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"436BEBDB-0F2A-4813-822B-D672D9B18924"}
 */
function onRecordSelection(event) {
	if (rt_traslado_id != null)
	{
		var $rel = reservatra_to_traslados.traslados_to_trasladodh
		var $nrec = $rel.getSize()
		if ($nrec == 0)
		{
			globals.DIALOGS.showErrorDialog('Error','No existe Tipo de Traslado','OK')
			return
		}
		var $muestra = new Array()
		var $devuelve = new Array()
		for (var i = 1 ; i <= $rel.getSize() ; i++)
		{
				var $reg 		= $rel.getRecord(i)
				var $comercial 	= $reg.trasdh_comercial
				var $id 		= $reg.trasdh_id
				$muestra.push($comercial)
				$devuelve.push($id)
		}
		application.setValueListItems('transfer_manual',$muestra, $devuelve)
	}	

	//if (reservatra_to_traslados)
	//{
		//var $rel = reservatra_to_traslados.traslados_to_mnemotec.mnemotec_to_tarifari
		//var $transfer = new Array()
		
		//globals.gHotelSeleccionado = reservatra_to_traslados.traslados_to_mnemotec.mnemotec_to_tarifari.tari_hote
		
		//for (var i = 1 ; i <= $rel.getSize() ; i++)
		//{
			//var $reg = $rel.getRecord(i)
			//var $desde = $reg.tari_desde
			//if ($transfer.indexOf($desde,0) == -1)
				//$transfer.push($desde)
		//}
		//application.setValueListItems('desde',$transfer)
	//}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8AB76B0C-25DC-4325-9D1C-60467BA12062"}
 */
function agregar(event) {
	reservatra_to_reservatrf.newRecord()
	var $pax = reservatra_to_reservacab.rc_qmayores + reservatra_to_reservacab.rc_qmenores
	reservatra_to_reservatrf.rf_qpaxs = $pax
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"82A38A17-36E0-449F-AEF6-44C51FB1BFD3"}
 */
function eliminar(event) {
	reservatra_to_reservatrf.deleteRecord()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"D507263B-C01F-40AE-969B-62C837C40EA4"}
 */
function eliminarTraslado(event) {
	reservatra_to_reservatrf.deleteAllRecords()
	controller.deleteRecord()
}
